//
//  RGMessageNoDataView.m
//  RedGrass
//
//  Created by wuyine on 2018/12/6.
//  Copyright © 2018年 hongcaosp. All rights reserved.
//

#import "RGMessageNoDataView.h"

@interface RGMessageNoDataView()
@property (nonatomic,strong) UILabel *title;
@property (nonatomic,strong) UILabel *subTitle;
@end

@implementation RGMessageNoDataView

- (instancetype)initWithTitle:(NSString *)title subTitle:(NSString *)subTitle{
    if (self = [super init]) {
        
        self.title.text = title;
        self.subTitle.text = subTitle;
        
        [self initUI];
        [self addMasonry];
    }
    return self;
}

- (void)initUI {
    [self addSubview:self.title];
    [self addSubview:self.subTitle];
}

- (void)addMasonry {
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.centerY.mas_equalTo(-100);
    }];
    
    [_subTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.equalTo(_title.mas_top).offset(16);
    }];
}

- (UILabel *)title {
    if (!_title) {
        _title = [[UILabel alloc] init];
        _title.textColor = UICOLOR_WITH_RGBINT(0xffffff);
        _title.font = FONT(customFontName, 17);
    }
    return _title;
}

- (UILabel *)subTitle {
    if (!_subTitle) {
        _subTitle = [[UILabel alloc] init];
        _subTitle.textColor = UICOLOR_WITH_RGBINT(0xffffff);
        _subTitle.font = FONT(customFontName, 14);
    }
    return _title;
}

@end
